home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19981211-19990422 / 000134_news@watsun.cc.columbia.edu _Mon Jan 18 13:15:47 1999.msg < prev    next >
Internet Message Format  |  2020-01-01  |  4KB

  1. Return-Path: <news@watsun.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id NAA22365
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Mon, 18 Jan 1999 13:15:46 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id MAA13421
  7.     for kermit.misc@watsun.cc.columbia.edu; Mon, 18 Jan 1999 12:53:41 -0500 (EST)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Subject: Re: not the same string with echo as with write file
  11. Date: 18 Jan 1999 17:53:40 GMT
  12. Organization: Columbia University
  13. Message-ID: <77vsf4$d39$1@newsmaster.cc.columbia.edu>
  14. To: kermit.misc@mailrelay2.cc.columbia.edu
  15.  
  16. In article <36a35d8c.97279@news.calvacom.fr>,
  17. Dominique Ottello <do11@calva.net> wrote:
  18. : MS-Kermit 3.15 under MS-DOS 6.2
  19. : With the under take file I want to have the same output string on screen
  20. : and in a file :
  21. : ; ------------ Beginning of take file ----------------
  22. : def Avion A320
  23. : def Ename AKA10AAJ
  24. : def Filelog Essai.log
  25. : def Log_S Fichier
  26. : def SN ECDD3022
  27. : def \%h T1
  28. : def \%n 005
  29. : def \%p 1459M55
  30. : ;
  31. : def print_PC open append \m(FileLog),-
  32. :  write file {\v(Time) \%1\13\10},close write-file
  33. : ;
  34. : ; Warning : the next two lines are only one line (Word Wrap)
  35. : ass Affiche copy C:\\KERMIT\\FICHIERS\\\m(Ename).\%h
  36. : C:\\\m(Avion)\\\%p\\\m(SN)\\\v(ndate).\%n
  37. : ;
  38. : echo {\m(Affiche)}
  39. : print_PC {\m(Affiche)}
  40. : ; ------------ End of take file ----------------
  41. : The echo line does exactly what I want :
  42. :    Warning : the next two lines are only one line (Word Wrap)
  43. : 14:55:37 copy C:\KERMIT\FICHIERS\AKA10AAJ.T1
  44. : C:\A320\1459M55\ECDD3022\19990118.005
  45. : Unfortunately, the content of the file ESSAI.LOG is not the same as the
  46. : screen but :
  47. :    Warning : the next two lines are only one line (Word Wrap)
  48. : 14:55:37 copy C:\KERMIT\FICHIERS\AKA10AAJ.T1
  49. : C:\A320∩┐╜9M55\ECDD3022∩┐╜90118.005
  50. : Despite the fact that the value seen by "show macro Affiche" is right, it
  51. : seems that it is badly interpreted inside the macro "print_PC".
  52. : The "\\\%p" is not interpreted as one "\" plus the content of the macro \%p
  53. : but as a character "\145" plus characters following i.e. "9M55". There is
  54. : the same thing for "\\\v(ndate)" that is interpreted as character "\199"
  55. : plus characters following i.e. "90118" in place of string "\19990118".
  56. : Is there a bug or a misunderstanding ?
  57. : Is there a way to bypass this problem ?
  58. Perhaps the worst thing about the Kermit script language is the conflict
  59. between its use of backslash (\) as the "distinguished character" and the
  60. use of backslash by DOS as the directory separator.  Luckily we can get
  61. around this problem in Windows 95/98/NT and OS/2 by using "/" rather than
  62. "\" as the directory separator (in most cases), but that is not possible
  63. in DOS.  Of course we would have different, but similar, problems no matter
  64. what other distinguished character was chosen.
  65.  
  66. When a DOS filename or a directory segment starts with a digit we have
  67. double trouble.  For example, suppose you have the following DOS
  68. directory:
  69.  
  70.   C:\123
  71.  
  72. (which, in fact, is well-known to Lotus users).  To Kermit, "\123" means
  73. "character number 123", which happens to be "{".
  74.  
  75. In your case, you have:
  76.  
  77.   C:\A320\1459M55\ECDD3022\19990118.005
  78.  
  79. turning into:
  80.  
  81.   C:\A320∩┐╜9M55\ECDD3022∩┐╜90118.005
  82.  
  83. Why is this happening?  Because ECHO is a command.  The argument of ECHO
  84. is evaluated once in its executation.
  85.  
  86. But print_PC is a macro.  Its argument is evaluated in the command:
  87.  
  88.   print_PC {\m(Affiche)}
  89.  
  90. itself, but then, inside the macro, \m(Affiche) has been assigned to \%1,
  91. which is evaluated again.
  92.  
  93. Try this:
  94.  
  95.   def print_PC open append \m(FileLog),-
  96.    write file {\v(Time) \fcontents(\%1)\13\10},close write-file
  97.  
  98. - Frank